package com.walle.concurrenttest.pattern.workthread;

/**
 * @author zhangjiapeng
 * @Package com.walle.concurrenttest.pattern.workthread
 * @Description: ${todo}
 * @date 2019/2/22 10:33
 */
public class WorkerThread extends Thread {

    private final Channel channel;

    public WorkerThread(String name,Channel channel) {
        super(name);
        this.channel = channel;
    }

    @Override
    public void run() {
        while (true){
            Request request = channel.takeRequest();
            request.execute();
        }
    }
}
